/*This file is part of PaperBall.

PaperBall is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PaperBall is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PaperBall.  If not, see <http://www.gnu.org/licenses/>.*/

package com.ran3000.paperball;

import com.ran3000.paperball.framework.DynamicBallObject;

public class Ball extends DynamicBallObject {
	public static final float BALL_MOVE_VELOCITY = 33;
	public static final float BALL_RADIUS = 1.12f;
	public static final float BALL_Y = 2;
	public static final int BALL_STATE_NORMAL = 0;
	public static final int BALL_STATE_SHIELDED = 1;
	
	float stateTime;
	int state;
	
	public Ball(float x) {
		super(x, BALL_Y, BALL_RADIUS);
		stateTime = 0;
		state = BALL_STATE_NORMAL;
	}
	
	public void update(float deltaTime) {
		velocity.add(World.gravity.x * deltaTime, 0);
		position.add(velocity.x * deltaTime, velocity.y *deltaTime);
		
		position.y = BALL_Y;
		
		bounds.center.set(position);
		
		stateTime += deltaTime;
	}
	
	public void hitBomb() {
		velocity.set(0, 0);
	}
}
